function bubble(arr) {
    for (let i = 0; i < arr.length - 1; i++) {
        let bool = true;
        for (let j = 0; j < arr.length - 1; i++) {
            if(arr[j]>arr[j+1]){
                [arr[j],arr[j+1]] = [arr[j+1],arr[j]];
                bool = false
            }
        }
        if(bool){
            break
        }
    }
    return arr
}

// 